package au.edu.swin.MelbourneMap;

/**
 * Data structure to define a node. 
 *
 * @author  Alexis Wellavize (s/n: 6033482)<br/>
 *           Dotan Tamir (s/n: 6532969)
 * @since   v1, created:  13/10/2012
 * @version v2, modified:  13/10/2012
 *
 */
 
class Node
{
    /// Name of road node belongs to
    private String roadName;
    /// easting and northing coordinates
    private Double easting, northing;
    /// Distance to parent node
    private Double distance;

    // Overloaded constructor
    public Node( String roadName, Double easting, Double northing, Double distance )
    {
    	this.roadName = roadName;
        this.easting = easting;
        this.northing = northing;
        this.distance = distance;
    }
    
    // Accessor methods
    
    /**
     * Returns road name of node.
     * @return Road name of node.
     */
    public String getRoadName()
    {
    	return roadName;
    }
    
    /**
     * Returns easting coordinate of node.
     * @return Easting coordinate of node.
     */    
    public Double getEasting()
    {
        return easting;
    }
    
    /**
     * Returns northing coordinate of node.
     * @return Northing coordinate of node.
     */    
    public Double getNorthing()
    {
        return northing;
    }
    
    /**
     * Returns distance from parent node to this node.
     * @return Distance from parent node to this node.
     */
    public Double getDistance()
    {
        return distance;
    }
    
    // Mutator methods
    
    /**
     * Sets the road name of this node.
     * @param roadName - The road name this node belongs to.
     */
    public void setRoadName( String roadName )
    {
    	this.roadName = roadName;
    }
    
    /**
     * Sets the northing coordinate of this node.
     * @param northing - The northing coordinate of this node.
     */
    public void setNorthing( Double northing )
    {
    	this.northing = northing;
    } 

    /**
     * Sets the easting coordinate of this node.
     * @param easting - The easting coordinate of this node.
     */    
    public void setEasting( Double easting )
    {
    	this.easting = easting;
    }

    /**
     * Sets the distance from parent node to this node.
     * @param distance - The distance from parent node to this node.
     */    
    public void setDistance( Double distance )
    {
    	this.distance = distance;
    }
}